$(function () {
    $("#tree").tree({
        animate:true,
        state:'closed',
        onClick:leafClick,
        url:"/menu/getRootMenu.do"

    });
    $(".icon-reload").click(function () {
        $("#tree").tree({
            animate:true,
            state:'closed',
            onClick:leafClick,
            url:"/menu/getRootMenu.do"

        });
    });
})
function leafClick(node) {
    var n = $("#tbs").tabs("getTab",node.text);
    if (!n) {
        if(node.url){
            $("#tbs").tabs("add", {
                title: node.text,
                closable: true,
                content: "<iframe src='/" + node.url + "' width='100%' height='99%' frameborder='0'>"
            });
        }
    }else{
        $("#tbs").tabs("select",node.text);
    }
}